<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link href="../vendors/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
    <script src="../vendors/jquery/dist/jquery.min.js"></script>
    <script src="../vendors/bootstrap/dist/js/bootstrap.js"></script>
    <script src="../vendors/bootstrap/extend/DT_bootstrap.min.js"></script>
</head>
<body>
<div id="dropharbor" style="margin-top: 20px" class="ui-droppable ui-sortable">
    <div class="row" style="width:100%">
        <div class="col-md-3">
            <div class="panel panel-default">

                <div class="panel-heading">摘要</div>
                <div id="harborsummary">
                </div>

            </div></div>
        <div class="col-md-8">
            <div class="panel panel-default">

                <div class="panel-heading">热门镜像仓库</div>
                <div style="margin-left:15px">
                    <table class="table">
                        <thead><tr><th style="width: 50%;overflow: hidden;">镜像仓库名</th><th style="width: 50%;overflow: hidden;">下载次数</th></tr></thead>
                        <tbody id="harborhotimage"></tbody>
                    </table></div></div>
        </div>
    </div>
</div>
<script>
    $(function () {
        harbordataload()
    })
    function harbordataload()
    {
        var storage = window.localStorage;
        var a1 = storage.kubersummary
        var str="";
        a1 = JSON.parse(a1);
        for(var item in a1)
        {
            str+="<li class=\"list-group-item\"> <span class=\"badge\">"+a1[item]+"</span>"+item+"</li>";
        }
        $("#harborsummary").append("<ul class=\"list-group\">"+str+"</ul>")
        a1 =storage.kuberhot;
        a1 = JSON.parse(a1);
        str="";
        for(var i=0;i<a1.length;i++)
        {
            str+="<tr><td>"+a1[i].name+"</td><td>"+a1[i].count+"</td></tr>";
        }
        $("#harborhotimage").append(str);
        /*$.ajax({
            type:"get",
            url:"/api/harbor/getsummary",
            success:function(res){
                res = JSON.parse(res);
                var str="";
                for(var item in res)
                {
                    str+="<li class=\"list-group-item\"> <span class=\"badge\">"+res[item]+"</span>"+item+"</li>";
                }
                $("#harborsummary").append("<ul class=\"list-group\">"+str+"</ul>")
            }
        })
        $.ajax({
            type:"get",
            url:"/api/harbor/gethostimage/5",
            success:function(res){
                res=JSON.parse(res);
                var str="";
                for(var i=0;i<res.length;i++)
                {
                    str+="<tr><td>"+res[i].name+"</td><td>"+res[i].count+"</td></tr>";
                }
                $("#harborhotimage").append(str);
            }
        })*/

    }
</script>
</body>
</html>